<html>
    <head>
        <script type="text/javascript" src="/js/home/index.js"></script>
        <link rel="stylesheet" href="/css/home/home.css" />
        <link rel="stylesheet" href="/css/home/message.css" />

<script type="text/javascript">
    $(function(){
        $("#saveForm, #cancelProfileForm, #savePasswordForm, #cancelPasswordForm").button();
        $( "#tabs" ).tabs({
                ajaxOptions: {
                        error: function( xhr, status, index, anchor ) {alert(index);
                                $( anchor.hash ).html(
                                        "Couldn't load this tab. We'll try to fix this as soon as possible. " +
                                        "If this wouldn't be a demo." );
                        }
                }
        });
    });
</script>

    <script type="text/javascript">
        $(document).ready(function() {
            $("#entity_birthdate").datepicker({dateFormat: 'yy-mm-dd'});
        });
    </script>
    </head>
    <body>
        <table id="" cellpadding="0" cellspacing="0" class="mainLayout">
            <tr>
                <td align="left" class="paddingRight10 mainLeftCol">
                    <table class="layoutForm" cellpadding="0" cellspacing="0" width="100%">
                        
                        <tr>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4">
                                <?php if($sf_user->hasFlash('message')): ?>
                                <div>
                                    <?php echo $sf_user->getFlash('message'); ?>
                                </div>
                            <?php endif; ?>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4">
                                <div id="tabs">
                                    <ul>
                                            <li><a href="#tabAccountDetail">Account Detail</a></li>
                                            <li><a href="#tabPassword">Password</a></li>
                                            <li><a href="#tabMapPreferences">Map Preference</a></li>
                                    </ul>
                                    <div id="tabAccountDetail">
                                        <form action="<?php echo url_for('home/profile') ?>" method="post" enctype="multipart/form-data">
                                            <table cellpadding="0" cellspacing="0" width="100%">
                                                <tr>
                                                    <td class="labelForm">
                                                        <?php echo $currentUser['firstname']->renderLabel() ?>
                                                    </td>
                                                    <td>
                                                        <?php echo $currentUser['firstname']->render(array('class' => 'inputForm')) ?><?php echo $currentUser['firstname']->renderError() ?>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="labelForm">
                                                        <?php echo $currentUser['lastname']->renderLabel() ?>
                                                    </td>
                                                    <td>
                                                        <?php echo $currentUser['lastname']->render(array('class' => 'inputForm')) ?><?php echo $currentUser['lastname']->renderError() ?>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="labelForm">
                                                        <?php echo $currentUser['position']->renderLabel() ?>
                                                    </td>
                                                    <td>
                                                        <?php echo $currentUser['position']->render(array('class' => 'inputForm')) ?><?php echo $currentUser['position']->renderError() ?>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="labelForm">
                                                        <?php echo $currentUser['university']->renderLabel() ?>
                                                    </td>
                                                    <td>
                                                        <?php echo $currentUser['university']->render(array('class' => 'inputForm')) ?><?php echo $currentUser['university']->renderError() ?>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="labelForm"><?php echo $currentUser['gender']->renderLabel() ?></td>
                                                    <td><?php echo $currentUser['gender']->render(array('class' => 'dropdownForm')) ?><?php echo $currentUser['gender']->renderError() ?></td>
                                                </tr>
                                                <tr>
                                                    <td class="labelForm"><?php echo $currentUser['birthdate']->renderLabel() ?></td>
                                                    <td><?php echo $currentUser['birthdate']->render(array('class' => 'inputForm')) ?><?php echo $currentUser['birthdate']->renderError() ?></td>
                                                </tr>
                                                <tr>
                                                    <td class="labelForm"><?php echo $currentUser['address']->renderLabel() ?></td>
                                                    <td><?php echo $currentUser['address']->render(array('class' => 'inputForm')) ?><?php echo $currentUser['address']->renderError() ?></td>
                                                </tr>
                                                <tr>
                                                    <td class="labelForm"><?php echo $currentUser['contact']->renderLabel() ?></td>
                                                    <td><?php echo $currentUser['contact']->render(array('class' => 'inputForm')) ?><?php echo $currentUser['contact']->renderError() ?></td>
                                                </tr>
                                                <tr>
                                                    <td class="labelForm">
                                                        <label><?php echo $currentUser['picture']->renderLabel() ?></label>
                                                    </td>
                                                    <td>
                        <!--                                <input type="file" name="flUserPicture" id="flUserPicture" />-->
                                                        <?php echo $currentUser['picture']->render(array('class' => 'inputForm')) ?><?php echo $currentUser['picture']->renderError() ?>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="labelForm"><?php echo $currentUser['emailaddress']->renderLabel() ?></td>
                                                    <td><?php echo $currentUser['emailaddress']->render(array('class' => 'inputForm', 'readonly' => true)) ?><?php echo $currentUser['emailaddress']->renderError() ?></td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td><?php //echo $currentUser['_csrf_token']->render(); ?></td>
                                                    <th><?php echo $currentUser->renderHiddenFields(); ?></th>
                                                </tr>
                                                <tr>
                                                    <td class="finalizeForm" align="right">
                                                        <input id="saveForm" type="submit" value="Save"/>
                                                    </td>
                                                    <td class="finalizeForm" align="center">
                                                        <input id="cancelProfileForm" type="reset" value="Cancel"/>
                                                    </td>
                                                </tr>
                                            </table>
                                        </form>
                                    </div>
                                    <div id="tabPassword">
                                        <form action="<?php echo url_for('home/changePassword') ?>" method="post">
                                            <table cellpadding="0" cellspacing="0" width="100%">
                                                <tr>
                                                    <td class="labelForm">
                                                        Old Password
                                                    </td>
                                                    <td>
                                                        <input type="password" id="txtOldPassword" name="txtOldPassword" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="labelForm">
                                                        New Password
                                                    </td>
                                                    <td>
                                                        <input type="password" id="txtnewPassword" name="txtnewPassword" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="labelForm">
                                                        Confirm Password
                                                    </td>
                                                    <td>
                                                        <input type="password" id="txtconfirmPassword" name="txtconfirmPassword" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="finalizeForm" align="right">
                                                        <input id="savePasswordForm" type="submit" value="Save"/>
                                                    </td>
                                                    <td class="finalizeForm" align="center">
                                                        <input id="cancelPasswordForm" type="reset" value="Cancel"/>
                                                    </td>
                                                </tr>
                                            </table>
                                        </form>
                                    </div>
                                    <div id="tabMapPreferences">
                                        <table cellpadding="0" cellspacing="0" width="100%">
                                            <tr>
                                                <td colspan="2" align="center">
                                                    UNDER CONSTRUCTION
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                            </div>
                            </td>
                        </tr>
<!--                        <tr>
                            <td colspan="4">
                                <ul class="tabs">
                                    <li><a id="lnkAccountDetail" class="fontSize15 activeTab" href="" > Account Detail</a></li>
                                    <li><a id="lnkPassword" class="fontSize15" href="" > Password </a></li>
                                    <li><a id="lnkMapPreference" class="fontSize15" href="" > Map Preference </a></li>
                                </ul>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4">&nbsp;</td>
                        </tr>
                        <tr>
                            <td class="headerForm" colspan="4">Account Detail</td>
                        </tr>
                        <tr>
                            <td class="theForm" colspan="4">

                        </td>
                        </tr>
                        
                        <tr>
                        <td class="theForm" colspan="4">
                            
                        </td>
                        </tr>-->
                    </table>
                </td>
                <td align="left" class="mainRightCol">
<!--                    <table cellpadding="0" cellspacing="0" width="100%">
                        <tr>
                            <td class="paddingLeft10 paddingTop10">
                                <?php //include_component('general', 'userProfilePicture', array('userid' => $sf_user->getAttribute('currentuser')->getId())) ?>
                            </td>
                        </tr>
                    </table>-->
                </td>
            </tr>
        </table>
        <br/>
    </body>
</html>